<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: AdjustEvent</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: AdjustEvent</h1>

    




<section>

<header>
    
        <h2>
        AdjustEvent
        </h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    <h4 class="name" id="AdjustEvent"><span class="type-signature"></span>new AdjustEvent<span class="signature">(dom_attach, x, y, obj_name, ExitFunction, scale)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Creates the adjusting event
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>dom_attach</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">The html element where the polygon lives</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>


            
            </td>

            

            

            <td class="description last">The x coordinates for the polygon points</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>


            
            </td>

            

            

            <td class="description last">The y coordinates for the polygon points</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>obj_name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">The name of the adjusted_polygon</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ExitFunction</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">the_function to execute once adjusting is done</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>scale</code></td>
            

            <td class="type">
            
                
<span class="param-type">float</span>


            
            </td>

            

            

            <td class="description last">Scaling factor for polygon points</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line14">line 14</a>
    </li></ul></dd>
    

    

    

    
</dl>
















    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="CenterOfMass"><span class="type-signature"></span>CenterOfMass<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    Compute center of mass for a polygon given array of points (x,y):
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line451">line 451</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="MoveCenterOfMass"><span class="type-signature"></span>MoveCenterOfMass<span class="signature">(event)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when the middle grab point is being moved
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">event</span>


            
            </td>

            

            

            <td class="description last">Indicates the middle grab point is moving
It modifies the control points to be consistent with the polygon shift</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line379">line 379</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="MoveControlPoint"><span class="type-signature"></span>MoveControlPoint<span class="signature">(event)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when one control point is being moved
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">event</span>


            
            </td>

            

            

            <td class="description last">Indicates a point is being moved and the index of such point</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line308">line 308</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="MoveScalingPoint"><span class="type-signature"></span>MoveScalingPoint<span class="signature">(event)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when one scaling point is being moved
It computes the position of the scaling point in relation to the polygon's center of mass
and resizes the polygon accordingly
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">event</span>


            
            </td>

            

            

            <td class="description last">Indicates a point is being moved and the index of such point</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line221">line 221</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="RemoveCenterOfMass"><span class="type-signature"></span>RemoveCenterOfMass<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function removes the middle grab point for a polygon
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line190">line 190</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="RemoveControlPoints"><span class="type-signature"></span>RemoveControlPoints<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function removes the displayed control points for a polygon
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line165">line 165</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="RemoveScalingPoints"><span class="type-signature"></span>RemoveScalingPoints<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function removes the displayed scaling points for a polygon
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line143">line 143</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="ShowCenterOfMass"><span class="type-signature"></span>ShowCenterOfMass<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function shows the middle grab point for a polygon.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line173">line 173</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="ShowControlPoints"><span class="type-signature"></span>ShowControlPoints<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function shows the control points for a polygon
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line151">line 151</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="ShowScalingPoints"><span class="type-signature"></span>ShowScalingPoints<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function shows the scaling points for a polygon
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line131">line 131</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StartEvent"><span class="type-signature"></span>StartEvent<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function starts the adjusting event:
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line71">line 71</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StartMoveCenterOfMass"><span class="type-signature"></span>StartMoveCenterOfMass<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when the middle grab point is clicked
It prepares the polygon for moving.
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line358">line 358</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StartMoveControlPoint"><span class="type-signature"></span>StartMoveControlPoint<span class="signature">(i)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when one control point is clicked
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>i</code></td>
            

            <td class="type">
            
                
<span class="param-type">int</span>


            
            </td>

            

            

            <td class="description last">the index of the control point being modified</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line287">line 287</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StartMoveScalingPoint"><span class="type-signature"></span>StartMoveScalingPoint<span class="signature">(i)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when one scaling point is clicked
It prepares the polygon for scaling.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>i</code></td>
            

            <td class="type">
            
                
<span class="param-type">int</span>


            
            </td>

            

            

            <td class="description last">the index of the scaling point being modified</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line202">line 202</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StopAdjustEvent"><span class="type-signature"></span>StopAdjustEvent<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function stops the adjusting event and calls the ExitFunction:
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line113">line 113</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StopMoveCenterOfMass"><span class="type-signature"></span>StopMoveCenterOfMass<span class="signature">(event)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when the middle grab point stops being moved
It updates the xml with the new coordinates of the polygon.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">event</span>


            
            </td>

            

            

            <td class="description last">Indicates the middle grab point is being moved and the index of such point</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line420">line 420</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StopMoveControlPoint"><span class="type-signature"></span>StopMoveControlPoint<span class="signature">(event)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when one control point stops being moved
It updates the xml with the new coordinates of the polygon.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">event</span>


            
            </td>

            

            

            <td class="description last">Indicates a point is being moved and the index of such point</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line335">line 335</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="StopMoveScalingPoint"><span class="type-signature"></span>StopMoveScalingPoint<span class="signature">(event)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This function is called when one scaling point stops being moved
It updates the xml with the new coordinates of the polygon.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">event</span>


            
            </td>

            

            

            <td class="description last">Indicates a point is being moved and the index of such point</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="adjust_event.js.html">adjust_event.js</a>, <a href="adjust_event.js.html#line264">line 264</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AdjustEvent.html">AdjustEvent</a></li><li><a href="canvas.html">canvas</a></li><li><a href="file_info.html">file_info</a></li><li><a href="image.html">image</a></li></ul><h3>Global</h3><ul><li><a href="global.html#AdjustPolygonButton">AdjustPolygonButton</a></li><li><a href="global.html#CreatePopupBubble">CreatePopupBubble</a></li><li><a href="global.html#CreatePopupBubbleCloseButton">CreatePopupBubbleCloseButton</a></li><li><a href="global.html#DrawCanvasClosePolygon">DrawCanvasClosePolygon</a></li><li><a href="global.html#DrawCanvasMouseDown">DrawCanvasMouseDown</a></li><li><a href="global.html#FinishStartup">FinishStartup</a></li><li><a href="global.html#getQueryVariable">getQueryVariable</a></li><li><a href="global.html#LMgetObjectField">LMgetObjectField</a></li><li><a href="global.html#LMnumberOfObjects">LMnumberOfObjects</a></li><li><a href="global.html#LoadAnnotation404">LoadAnnotation404</a></li><li><a href="global.html#LoadAnnotationSuccess">LoadAnnotationSuccess</a></li><li><a href="global.html#LoadTemplate404">LoadTemplate404</a></li><li><a href="global.html#LoadTemplateSuccess">LoadTemplateSuccess</a></li><li><a href="global.html#SetAllAnnotationsArray">SetAllAnnotationsArray</a></li><li><a href="global.html#StartDrawEvent">StartDrawEvent</a></li><li><a href="global.html#StartEditEvent">StartEditEvent</a></li><li><a href="global.html#StartEditVideoEvent">StartEditVideoEvent</a></li><li><a href="global.html#StartupLabelMe">StartupLabelMe</a></li><li><a href="global.html#StopDrawEvent">StopDrawEvent</a></li><li><a href="global.html#StopEditEvent">StopEditEvent</a></li><li><a href="global.html#UndoCloseButton">UndoCloseButton</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0-dev</a> on Thu Mar 12 2015 16:00:31 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>